package com.example.fitapp.activity.activity;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;

import com.example.fitapp.activity.R;
import com.example.fitapp.activity.adapter.CardFragmentPagerAdapter;
import com.example.fitapp.activity.bean.QuestionInfo;

import java.util.List;

public class AnswerActivity extends AppCompatActivity {
    private ViewPager viewPager;
    private TextView tvBottomText;
    private CardFragmentPagerAdapter mAapter;
    private List<QuestionInfo> mList;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_answer);

        viewPager =(ViewPager) findViewById(R.id.viewpager);
        tvBottomText =(TextView)findViewById(R.id.tv_bottom_text);
//      todo,填充mList
//        getData();
//        updateUI();

    }

    private void updateUI(){
        mAapter = new CardFragmentPagerAdapter(getSupportFragmentManager(),mList);
        viewPager.setAdapter(mAapter);
//        设置缓存几个页面
        viewPager.setOffscreenPageLimit(3);
    }
}
